/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.transas.zorlog.data;

/**
 * Interface for getting the time value as seconds for the given index.
 * Used for displaying a time line.
 * @author amalikov
 */
public abstract class TimeSource {
	public TimeSource(TimeFormatter formatter, float playbackRate) {
		this.formatter = formatter;
		this.playbackRate = playbackRate;
	}
	
	public abstract double getValue(int index);
	
	public final String getValueAsString(int index) {
		return formatter.get(getValue(index));
	}
	
	public final TimeFormatter getTimeFormatter() {
		return formatter;
	}
	
	public final float getPlaybackRate() {
		return playbackRate;
	}
	
	private final TimeFormatter formatter;
	private final float playbackRate;
}
